package com.zjy.software.day15;

public class ProducerConsumerTest {
    public static void main(String[] args){
        //第一步   创建账户
        Account account=new Account();
        account.setCount(10);

        //第二步   创建生产者线程
        Runnable producer=new Producer(account);
        Thread producerThread=new Thread(producer);

        //第三步   创建消费者线程
        Runnable consumer=new Consumer(account);
        Thread consumerThread=new Thread(consumer);

        Runnable runableConsumer=new Consumer(account);
        Thread threadConsumer=new Thread(runableConsumer);

        //第四步   启动线程
        producerThread.start();
        consumerThread.start();
        threadConsumer.start();

    }

}
